// pages/xz/xz.js
var app = getApp();
Page({

  /**
   * 页面的初始数据
   */
  data: {
    choosed: 1,
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function(options) {

  },

  // 选择客户端角色
  chooseRole: function(e) {
    var choosed = e.currentTarget.dataset.choosed;
    if (this.data.choosed != choosed) {
      this.setData({
        choosed: choosed,
      })
    } else {
      return false;
    }
  },
  choosereturn: function(e) {
    console.log("666", this.data.choosed)//选择用户1或医生2
    wx.setStorageSync("roleType", this.data.choosed);
    var roleType = wx.getStorageSync('roleType');
      if (roleType == 2) {
          wx.navigateTo({        
          url: "../doctor-login/doctor-login"
        })
      }else{
        wx.switchTab({
          url: "../index/index"
        })
      }
  }
})